HomeKit Name Sync
Feature Introduction
Synchronize device and Service names between “Home” app and Aqara Home for the same device. When users click the name sync feature, a sync selection dialog appears where they can choose to sync names from Aqara Home to “Home” app, or sync names from “Home” app to the home page card.
Sync Logic
- Get all device and Service names under the current home from the cloud (excluding devices that don't support HomeKit).
- Pull all device and Service names from HomeKit (only showing devices manufactured by Xiaomi/Aqara).
- Match device names from both ends using device DID, then find corresponding Services by DID and match them by Service type.
- When there are multiple Services of the same Service Type, sync them in order; for example, for a three-button switch, the Apple-side service order is buttons 1/2/3.
- When syncing names containing special characters to HomeKit, special characters need to be converted to spaces.(“-” is retained)
Exception Cases
When syncing from Aqara Home to Apple, special characters in names need to be converted to spaces.
Result
- When network error occurs, prompt “Name sync failed, network error”.
- When “Home” permission is not enabled, prompt to enable access to home data settings first.
- Show Loading popup with text “Syncing names, please wait”.
- When all names sync successfully, prompt “Name sync successful”.
- When all names fail to sync, prompt “Name sync failed, please ensure devices are online in Apple's ‘Home' app”.
- When partial sync fails, prompt “Some names failed to sync, please ensure network connection is stable and all devices are online in Apple's ‘Home' app”.